package com.mkh.st.common.core.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum MenuEnum {
	HOME("首页","home"),
	BASE("基础","base"),
	BASE_ORGANIZATION("组织","base_organization"),
	BASE_ORGANIZATION_GROUP("集团管理","base_organization_group"),
	BASE_ORGANIZATION_COMPANY("公司设置","base_organization_company"),
	BASE_ORGANIZATION_BUSINESS("业务设置","base_organization_business"),
	BASE_ORGANIZATION_WAREHOUSE("仓库管理","base_organization_warehouse"),
	BASE_COMMODITY("商品","base_commodity"),
	BASE_COMMODITY_GROUP("集团商品","base_commodity_group"),
	BASE_COMMODITY_SITE("站点商品","base_commodity_site"),
	BASE_COMMODITY_SETTAXRATE("批量税率设置","base_commodity_setTaxRate"),
	BASE_COMMODITY_UNITCONTROL("单位管理","base_commodity_unitControl"),
	BASE_COMMODITY_CLASSIFICATION("分类管理","base_commodity_classification"),
	BASE_COMMODITY_BRAND("品牌管理","base_commodity_brand"),
	BASE_CLIENT("客户","base_client"),
	BASE_CLIENT_CLIENTGROUP("客户集团","base_client_clientGroup"),
	BASE_CLIENT_CLIENTINFO("客户资料","base_client_clientInfo"),
	BASE_CLIENT_CLIENTTYPE("客户类型","base_client_clientType"),
	BASE_MARKET("销售","base_market"),
	BASE_MARKET_SALESGUIDANCEPRICE("销售指导价","base_market_salesGuidancePrice"),
	BASE_MARKET_NEGOTIATEDPRICE("协议报价","base_market_negotiatedPrice"),
	BASE_MARKET_PRICING("定价报价","base_market_pricing"),
	BASE_PURCHASE("采购","base_purchase"),
	BASE_PURCHASE_SUPPLIER("供应商","base_purchase_supplier"),
	BASE_PURCHASE_BUYER("采购员","base_purchase_buyer"),
	BASE_PURCHASE_GROP("采购组","base_purchase_group"),
	BASE_PURCHASE_PRICE("采购价","base_purchase_price"),
	BASE_PURCHASE_COMMODITYSUPPLIER("商品供应","base_purchase_commoditySupplier"),
	BASE_FINANCE("财务","base_finance"),
	BASE_FINANCE_TYPEOFEXPENSE("费用类型","base_finance_typeOfExpense"),
	PURCHASEMANAGEMENT("采购","purchaseManagement"),
	PURCHASEMANAGEMENT_COMMODITY("商品分配","purchaseManagement_commodity"),
	PURCHASEMANAGEMENT_SUPPLY("供应查看","purchaseManagement_supply"),
	PURCHASEMANAGEMENT_STOCKUP("备货单据","purchaseManagement_stockUp"),
	PURCHASEMANAGEMENT_PURCHASE("采购单据","purchaseManagement_purchase"),
	PURCHASEMANAGEMENT_SALESRETURN("退货单据","purchaseManagement_salesReturn"),
	SELL("订单","sell"),
	SELL_INDENT("订单列表","sell_indent"),
	SELL_GOODSTOREPLACE("商品替换","sell_goodsToReplace"),
	SELL_RETURNSANDREFUNDS("退款退货","sell_returnsAndRefunds"),
	SELL_ABNORMALORDERS("异常订单","sell_abnormalOrders"),
	SELL_DIFFERENCE("差异单","sell_difference"),
	STORE("仓库","store"),
	STORE_SHIPMENTS("发货任务","store_shipments"),
	STORE_RECEIVING("收货任务","store_receiving"),
	STORE_STOCKMANAGEMENT("入库管理","store_stockManagement"),
	STORE_STOCKDETAIL("入库明细","store_stockDetail"),
	STORE_STOCKREMOVAL("出库管理","store_stockRemoval"),
	STORE_OUTBOUNDDETAIL("出库明细","store_outbounddetail"),
	STORE_SEARCH("出入库查询","store_search"),
	STORE_REPORTEDANDOVERFLOW("报损报溢","store_reportedAndoverflow"),
	STORE_STOCKTAKING("库存盘点","store_stockTaking"),
	STORE_ALLOT("库存调拨","store_allot"),
	STORE_INVENTORY("现有库存","store_inventory"),
	STORE_SORTERMANAGE("分拣员管理","store_sorterManage"),
	STORE_OPENINGINVENTORY("期初库存","store_openingInventory"),
	FINANCE("财务","finance"),
	FINANCE_SUPPLIER("供应商","finance_supplier"),
	FINANCE_SUPPLIER_COSTSHEET("费用单（供应商）","finance_supplier_costSheet"),
	FINANCE_SUPPLIER_RECONCILIATION("对账单","finance_supplier_reconciliation"),
	FINANCE_SUPPLIER_STATEMENT("采购发票","finance_supplier_statement"),
	FINANCE_SUPPLIER_ADVANCE("预付款","finance_supplier_advance"),
	FINANCE_SUPPLIER_PAYMENTREGISTER("付款登记","finance_supplier_paymentRegister"),
	FINANCE_CLIENT("客户","finance_client"),
	FINANCE_CLIENT_SENDERSLIST("补差单（客户）","finance_client_sendersList"),
	FINANCE_CLIENT_STATEMENTOFACCOUNT("对账单","finance_client_statementOfAccount"),
	FINANCE_CLIENT_SALESSLIP("销售发票","finance_client_salesSlip"),
	FINANCE_CLIENT_ADVANCESRECEIVED("预收款","finance_client_advancesReceived"),
	FINANCE_CLIENT_GATHERING("收款登记","finance_client_gathering"),
	REPORT("统计","report"),
	REPORT_PRICECHANGES("价格异动","report_priceChanges"),
	REPORT_PRICETREND("价格走势","report_priceTrend"),
	SYSTEM("系统","system"),
	SYSTEM_IMG("图片配置","system_img"),
	SYSTEM_BUSINESS("业务设置","system_business"),
	SYSTEM_ACCOUNTNUMBER("账号设置","system_accountNumber"),
	SYSTEM_DOCUMENTSCODE("单据编码","system_documentsCode"),
	SYSTEM_DOCUMENTSTYPE("单据类型","system_documentsType"),
	SYSTEM_ROLE("角色管理","system_role"),
	SYSTEM_RATE("税率配置","system_rate");
	/**
	 * 类型
	 */
	private String description;

	/**
	 * 描述
	 */
	private String code;

	public static MenuEnum get(String code){
		if (Objects.isNull(code)) {
			return null;
		}
		for (MenuEnum menuEnum : MenuEnum.values()){
			if (code.equals(menuEnum.code))  return menuEnum;
		}
		return null;
	}
}
